package main

import (
	"fmt"
	"log"
	"net/http"
	"time"

	"gitee.com/dark.H/go-utils/s"
)

func main() {

	// a := s.Str("").ANSISave().ANSICursor(0, 0).ANSIClearThisLine() + s.Str("test").ANSIRestore()
	// a.Print()
	// s.Str("--- end test---").Print()

	// s.Str("").ANSICursor(2, 2).ANSIClearThisLine().A("some ").Print()
	// time.Sleep(1 * time.Second)
	fmt.Println("ss")
	oneTest := func(name string) {
		f := "https://gomirrors.org/dl/go/go1.18.1.windows-amd64.msi"
		resp, err := http.Get(f)
		if err != nil {
			log.Fatal(err)
		}
		// resp.Header

		pip := s.AsPip(resp)
		pip.Copy(name+"tes.bin", true)

	}
	go oneTest("one")
	time.Sleep(1 * time.Second)
	go oneTest("three")
	time.Sleep(1 * time.Second)
	go oneTest("four")

	time.Sleep(1 * time.Second)
	oneTest("two")
}
